package com.jsy.mini12306.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;


/**
 * 列车票订单(TicketOrder)实体类
 *
 * @author: SongyangJi
 * @since: 2021-09-02 21:22:25
 * @description:
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TicketOrder implements Serializable {
    private static final long serialVersionUID = -21090298179598035L;
    /**
     * 订单id（雪花）
     */
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long orderId;
    /**
     * 旅客id
     */
    private Long buyerId;
    /**
     * 下单日期时间
     */
    private LocalDateTime dateTime;
    /**
     * 车次id
     */
    private Integer trainId;
    /**
     * 发车时间
     */
    private LocalDate departDate;
    /**
     * 起点站id
     */
    private Integer startStationId;
    /**
     * 终点站id
     */
    private Integer endStationId;
    /**
     * 列车次（冗余）
     */
    private String trainName;
    /**
     * 订单号
     */
    private Integer orderNum;

    @TableField(exist = false)
    private List<TicketOrderIterm> ticketOrderIterms;

}
